<!DOCTYPE html>
<html>
<head>
  <title>WEBRTC Demo</title>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1"
        name="viewport">
  <link href='./css/bootstrap.css'
        rel="stylesheet">
  <link href='./css/style.css'
        rel='stylesheet'>
  <link href="../assets/css/pure-min.css"
        rel="stylesheet">
  <link href="../assets/css/baby-blue.css"
        rel="stylesheet">
</head>
<body>
  <!-- 登录  -->
  <div class="container"
       id="input-container">
    <div class="search-noresults">
      <section class="normal markdown-section">
        <h2 id="屏幕分享">屏幕分享</h2>
        <p>WebRTC不仅可提供以摄像头为源的视频通讯功能，也能PC屏幕分享，但目前Chrome浏览器，无法直接截取主机屏幕，故无法使用此功能，需要插件支持才能实现屏幕共享功能。</p>
        <blockquote>
          <p>请移步 <a href="https://cloud.tencent.com/document/product/647/17847"
             target="_blank">插件安装指引</a></p>
        </blockquote>
      </section>
    </div>
    <div class="login-box">
      <div class="form-group">
        <div class="hide">
          <label for="sdkappid">SDKAPPID:&nbsp;</label> <input class="form-control"
               id="sdkappid"
               type="text"
               value="1400037025">
        </div><label for="userId">用户名:</label> <input class="form-control"
             id="userId"
             type="text"
             value=""> <label for="room-number">房间号:</label> <input class="form-control"
             id="roomid"
             type="text"
             value="100910">
      </div><button class="btn btn-default"
           onclick="detect()"
           type="button">屏幕分享插件检测</button><br>
      <h5>分享源</h5><label for=""><input checked id="screen" type="checkbox" value="screen">
        <span>screen</span></label>
        <label for="">
          <input checked id="window" type="checkbox" value="window"> <span>window</span></label> <label for=""><input id="audio"
             type="checkbox"
             value="audio"> <span>audio</span></label> 
             <label for=""><input checked id="tab" type="checkbox" value="tab"> <span>tab</span></label> <button class="btn btn-default"
           onclick="start('screen')"
           type="button">屏幕分享</button><br>
      <button class="btn btn-default"
           onclick="start('camera')"
           type="button">视频通话</button><br>
      <button class="btn btn-default"
           onclick="start('audience')"
           type="button">观看</button>
      <p>注意：如果房间已经存在，则加入房间</p>
    </div>
  </div><!-- 登录  -->
  <!-- RTC  -->
  <div id="video-section"
       style="display: none">
    <button class="btn btn-default"
         onclick="getCamera()"
         type="button">摄像头</button> <button class="btn btn-default"
         onclick="getScreen()"
         type="button">屏幕分享</button> <button class="btn btn-default"
         onclick="switchAudioDevice()"
         type="button">切换麦克风</button><br>
    <div id="remote-video-wrap"></div>
  </div><!-- RTC  -->
  <!-- jquery Demo用到，WebRTCAPI不依赖 -->
  <script src="../assets/libs/jquery.min.js"></script> 
  <script src="../assets/libs/vconsole.min.js"></script> 
  <script>

    // var vConsole = new VConsole();
  </script> <!-- demo 部分 -->
   
  <script src="../dist/WebRTCAPI.min.js"></script> 
  <script>

    document.write('<script src="./js/index.js?v='+new Date()+'" type="text/javascript"><\/scr'+'ipt>')
  </script> 
  <script>

        var _mtac = {"senseHash":0};
        (function() {
            var mta = document.createElement("script");
            mta.src = "//pingjs.qq.com/h5/stats.js";
            mta.setAttribute("name", "MTAH5");
            mta.setAttribute("sid", "500538821");
            mta.setAttribute("cid", "500538834");
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(mta, s);
        })();
  </script> <!-- Global site tag (gtag.js) - Google Analytics --> 
  <script async
        src="https://www.googletagmanager.com/gtag/js?id=UA-121844058-1"></script> 
  <script>
   window.dataLayer = window.dataLayer || [];   function gtag(){dataLayer.push(arguments);}   gtag('js', new Date());    gtag('config', 'UA-121844058-1'); 
  </script>
</body>
</html>
